<?php
    // 更改成员信息
    header("Content-type:text/html;charset=utf-8");
    $mysqli = new mysqli("localhost","root","root","materialadmin");
    if($mysqli->connect_errno != 0){
        die();
    };

    $Id = $_POST["id"];
    $role = $_POST["role"];
    $name = $_POST["name"];
    $department = $_POST["department"];
    $superior = $_POST["superior"];

    $sql = "update rolemanagement set role='$role',name='$name',department='$department',superior='$superior' where Id=$Id";

    // echo $mysqli->query($sql)
    if ($mysqli->query($sql) === TRUE ){
        $data["code"] = 3000;
        $data["msg"] = "更改成功";
    };
    print_r(json_encode($data));
?>